﻿using Coldairarrow.Entity;
using Coldairarrow.Entity.Base;
using Coldairarrow.Util;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Coldairarrow.IBusiness
{
    /// <summary>
    /// 操作者对应的法人组织
    /// </summary>
    public interface IOperatorDept
    {
        /// <summary>
        /// 获取操作者的法人组织id
        /// </summary>
        /// <returns></returns>
        Task<DeptData> GetOperatorDept();

        /// <summary>
        /// 获取当前操作人上级工厂
        /// </summary>
        /// <returns></returns>
        Task<DeptData> GetOperatorDeptGongchang();

        /// <summary>
        /// 获取当前操作人上级工厂
        /// </summary>
        /// <returns></returns>
        Task<DeptData> GetOperatorDeptFaren();

        /// <summary>
        /// 获取当前操作人的部门id
        /// </summary>
        /// <returns></returns>
        Task<DeptData> GetOperatorDeptBumenId();

        /// <summary>
        /// 获取车间的工厂Id
        /// </summary>
        /// <param name="workshopid"></param>
        /// <returns></returns>
        Task<DeptData> GetOperatorGongChang(string workshopid);
        /// <summary>
        /// 获取操作者的部门信息
        /// </summary>
        /// <returns></returns>
        Task<DeptData> GetOperatorDeptType();

        /// <summary>
        /// 获取登录人法人下所有的部门信息
        /// </summary>
        /// <returns></returns>
        Task<List<string>> GetDeptString();

        /// <summary>
        /// 获取登录人所属工厂下所有的仓库信息
        /// </summary>
        /// <returns></returns>
        Task<List<string>> GetStorString();

        /// <summary>
        /// 获取登录人所属工厂下所有的仓库信息
        /// </summary>
        /// <param name="DeptId">操作者的工厂Id</param>
        /// <returns></returns>
        Task<List<string>> GetStorList(string DeptId);

        /// <summary>
        /// 获取登录人部门下所有deptId
        /// </summary>
        /// <returns></returns>
        Task<List<string>> GetDeptIds();

        /// <summary>
        /// 获取登录人工厂下所有deptId
        /// </summary>
        /// <returns></returns>
        Task<List<string>> GetFactoryIds();

        /// <summary>
        /// 获取登录人所属工厂下所有的车间信息
        /// </summary>
        /// <param name="DeptId">操作者的工厂Id</param>
        /// <returns></returns>
        Task<List<string>> GetWorkshopString(string DeptId);

        Task<List<string>> GetBumenString(string DeptId);

        /// <summary>
        /// 获取全局变量
        /// </summary>
        /// <param name="LinkType">全局变量码</param>
        /// <returns></returns>
        Task<Base_LinkType> GetLinkType(string LinkType);

    }

    public class DeptData
    {
        /// <summary>
        /// 组织id
        /// </summary>
        public string DetpId { get; set; }

        /// <summary>
        /// 组织名称
        /// </summary>
        public string DeptName { get; set; }

        /// <summary>
        /// 组织类型
        /// </summary>
        public int? DeptType { get; set; }

        /// <summary>
        /// 客户Id
        /// </summary>
        public string SupplierId { get; set; }
    }

}
